from base import Base
from selenium.webdriver.common.by import By
class Page(Base):
    def ssk(self):
        print('点击搜索框')
        loc = (By.ANDROID_UIAUTOMATOR, 'new UiSelector().text("搜商品名称 作者 出版社 ISBN")')
        ele = self.find_ele(loc)
        return ele
    def ssnr(self):
        print('输入搜索内容')
        loc=(By.CLASS_NAME,'android.widget.EditText')
        ele=self.find_ele(loc)
        return ele
    def ssanniu(self):
        print('点击搜索按钮')
        loc=(By.ID,'com.kongfz.app:id/tvSearch')
        ele=self.find_ele(loc)
        return ele
    def tupian(self):
        print('点击图片')
        loc=(By.XPATH,'(//android.widget.ImageView[@resource-id="com.kongfz.app:id/ivPic"])[7]')
        ele=self.find_ele(loc)
        return ele
    def sc(self):
        print('点击收藏')
        loc=(By.XPATH,'//android.widget.TextView[@text=""]')
        ele=self.find_ele(loc)
        return ele
    def tc(self):
        print('点击退出')
        loc=(By.XPATH,'//androidx.compose.ui.platform.ComposeView[@resource-id="com.kongfz.app:id/compose_view"]/android.view.View/android.view.View[2]/android.view.View[1]')
        ele=self.find_ele(loc)
        return ele
    def dy(self):
        print('断言水浒传是否存在')
        loc=(By.ID,'com.kongfz.app:id/tvKeyword')
        ele=self.find_ele(loc)
        return ele
    def dy1(self):
        print('断言综合是否存在')
        loc = (By.XPATH, '//android.widget.TextView[@resource-id="com.kongfz.app:id/tvName" and @text="综合"]')
        ele = self.find_ele(loc)
        return ele